<template>
    <!-- <div class="delete-dialog">
       <yh-dialog drag :visible.sync="deleteBidShow1" title="撤单确认" @close="closeDialog">
            <el-form v-model="cancelOrder" label-width="120px">
                <el-row>
                    <el-col :span="24">
                        <el-form-item label="外部指令序号">
                            <el-input v-model="cancelOrder.originOuterOrderCode" disabled></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="指令序号">
                            <el-input v-model="cancelOrder.instNo"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="撤单人">
                            <el-input v-model="cancelOrder.tradeUserName" disabled></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="撤单方式">
                            <el-select v-model="cancelOrder.cancelOrderType">
                                <el-option key="1" value="1" label="1 指令序号"></el-option>
                                <el-option key="2" value="2" label="2 外部指令序号"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="序号">
                            <el-input v-model="cancelOrder.id"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="24">
                        <el-form-item label="备注">
                            <el-input v-model="cancelOrder.remark" type="textarea"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
            <div slot="footer">
                <el-button @click="closeDialog">关闭</el-button>
                <el-button type="primary" @click="confirmDialog">确定</el-button>
            </div>
       </yh-dialog>
    </div> -->
    <div class="delete-dialog">
        <!--<yh-dialog drag :visible.sync="deleteBidShow1" title="撤单确认" @close="closeDialog">

            <div slot="footer">
                <el-button @click="closeDialog">关闭</el-button>
                <el-button type="primary" @click="confirmDialog">确定</el-button>
            </div>
       </yh-dialog> -->
    </div>
</template>
<script lang="ts">
import { UUID } from '@/utils/tools';
import { getUser } from '@/utils/user-util';
import { Component, Vue, Prop } from 'vue-property-decorator';

@Component({
    name: 'DeleteInvest',
    components: {},
})
// 暂时无用
export default class DeleteInvest extends Vue {
    @Prop({ default: false }) deleteBidShow: boolean;
    @Prop() rowData: any;

    private cancelOrder: any = {
        cancelOrderType: '1',
        tradeUser: getUser().userCode, // 当前用户
        tradeUserName: getUser().userName, // 当前用户
        orderType: '4',
        instructionType: '10',
        instNo: '',
        originOuterOrderCode: '',
        outerOrderCode: UUID() + '-' + new Date().getTime(),
        requestId: UUID() + '-' + new Date().getTime(),
    };

    private deleteBidShow1: boolean = false;

    mounted() {
        this.deleteBidShow1 = JSON.parse(JSON.stringify(this.deleteBidShow));
        console.log(this.rowData);
        this.cancelOrder.instNo = this.rowData.instNo;
        this.cancelOrder.originOuterOrderCode = this.rowData.originOuterOrderCode;
        this.cancelOrder.serialNo = this.rowData.serialNo;
        // console.log(this.cancelOrder, 'cancelOrder');
        this.confirmDialog();
    }

    // 确定撤单
    private confirmDialog() {
        this.$axios
            .post('/dataEngine/order/seniorBond/cancelOrder', this.cancelOrder)
            .then((res: any) => {
                this.deleteBidShow1 = false;
                this.$emit('deleteBidReturn', 'success');
            })
            .catch(() => {
                this.yh_message_error('撤单失败');
                this.closeDialog();
            });
    }

    private closeDialog(): void {
        this.deleteBidShow1 = false;
        this.$emit('deleteBidReturn', 'cancel');
    }
}
</script>
<style lang="scss" scoped>
/deep/ .el-dialog .el-dialog__body {
    padding: 20px 30px 10px 10px;
}
/deep/ .el-form-item {
    margin-bottom: 10px !important;
}
</style>
